/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.upn.sigemfi.can.beans;

import edu.upn.sigemfi.can.bc.TransaccionGiroWebDelegate;
import edu.upn.sigemfi.can.be.TransaccionGiroWeb;
import java.util.List;

/**
 *
 * @author Orlando ( U )
 */
public class TransaccionGiroWebController {

    private TransaccionGiroWebDelegate delegado;
    private TransaccionGiroWeb transaccionGiroWeb;

    public TransaccionGiroWebController(){
        delegado = new TransaccionGiroWebDelegate();
    }

    public List<TransaccionGiroWeb> getTransaccionesGirosWebs() {
        try {
            return delegado.listar();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

    public String nuevo() {
        transaccionGiroWeb = new TransaccionGiroWeb();
        return "nuevo";
    }

    public String editar() {
        return "editartransacciongiroweb";
    }

    public String registrar() {
        try {
            delegado.crear(transaccionGiroWeb);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "volver";
    }

    public String eliminar(){
        try {
            delegado.eliminar(transaccionGiroWeb);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "volver";
    }

    public String actualizar() {
        try {
            delegado.editar(transaccionGiroWeb);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "volver";
    }

    public TransaccionGiroWeb getTransaccionGiroWeb() {
        return transaccionGiroWeb;
    }

    public void setTransaccionGiroWeb(TransaccionGiroWeb transaccionGiroWeb) {
        this.transaccionGiroWeb = transaccionGiroWeb;
    }

}
